import { request } from '@/service/request';

/** 获取微信支付配置列表 */
export function fetchGetWithdrawList(params?: Api.Business.WithdrawFeeSearchParams) {
  return request<Api.Business.WithdrawFeeList>({
    url: '/withdraw_fee/getAll',
    method: 'post',
    data: params
  });
}

/** 新增微信支付配置 */
export function fetchCreateWithdrawConfig(data: Api.Business.WithdrawFeeOperateParams) {
  return request<boolean>({
    url: '/withdraw_fee/add',
    method: 'post',
    headers: {
      isEncrypt: true,
      repeatSubmit: false
    },
    data
  });
}

/** 修改微信支付配置 */
export function fetchUpdateWithdrawConfig(data: Api.Business.WithdrawFeeOperateParams) {
  return request<boolean>({
    url: '/withdraw_fee/update',
    method: 'post',
    data
  });
}
